<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo Yii::$app->name;?> 后台管理</title>
<?php $this->HeaderView(['slide']);?>

<script type="text/javascript" src="<?php echo $this->root_dir; ?>/static/common/js/jquery.tablednd.js"></script>
</head>
<body class="view_form" id="view_form_Model">

        <form class="view-form-form" method="post" action="<?php echo $this->createUrl(['user/index/config', 'modelid'=>$modelid, 'module'=> $module]);?>" enctype="multipart/form-data">
        <input type="hidden" id="catid" name="Models[modelid]" value="<?php echo $modelid;?>">
        
                    <div class="slideTxtBox mtop-0">
        <div class="hd">
                    <ul>
                
                <li><a href="javascript:;"><span></span>基本设置</a></li>
                <li><a href="javascript:;"><span></span>后台首页</a></li>
            </ul>
                </div>
        <div class="bd">
                    <ul>
            <table class="view-form-input" border="0" cellspacing="0" cellpadding="0" width="100%">
                <tbody>

                    <tr>
                        <th valign="top" class="td-title"><label for="catid">允许新会员注册：</label></th>
                        <td class="td-input">
                        <?php
						

echo submodule\widgets\SubmoduleWidget::widget(['viewPath'=>'switchbutton', 'options' => [
    'primarykey'=> 'modelid',
	'id'=> 'isdefault',
	'name'=> 'Module[isdefault]',
	'value'=> @$model->isdefault,
	//'attributes'=> array_merge($model->attributes, array('modelid'=>$modelid)),
	//'model'=> $model,
	'setting'=> ['defaultvalue'=>0]

]]);
?>
                        
                        </td>
                    </tr>
                                        <tr>
                        <th valign="top" class="td-title"><label for="catid">注册需要管理员审核：</label></th>
                        <td class="td-input"></td>
                    </tr>
                    </tr>
                                        <tr>
                        <th valign="top" class="td-title"><label for="catid">注册协议：</label></th>
                        <td class="td-input">
                        <?php
						echo submodule\widgets\SubmoduleWidget::widget(['viewPath'=>'textarea', 'options' => [
							'primarykey'=> 'modelid',
							'id'=> 'isdefault',
							'name'=> 'Module[isdefault]',
							'value'=> @$model->isdefault,
							//'attributes'=> array_merge($model->attributes, array('modelid'=>$modelid)),
							//'model'=> $model,
							'setting'=> ['defaultvalue'=>0]
						
						]]);
						?>
                        
                        </td>
                    </tr>

                        </tbody>
            </table>
            </ul>
            <?php if($modelid){?>
             <ul>

            </ul>
            <?php
			}
			?>
                </div>
    </div>
    <input type="submit" value="提交" name="sbmt" class="btn-submit mt-10" style="margin-left:120px">
<?=$this->csrfToken()?>

    </form>
<script type="text/javascript">
jQuery(".slideTxtBox").slide({trigger:"click"});
$(function(){
	$(".view-form-form").validate({	
		rules: {
			"Models[name]": {
				required: true,
			},
			"Models[tablename]": {
				required: true,
				remote: {
					url: "<?php echo $this->createUrl(['/models/check-tablename'])?>",     //后台处理程序
					type: "get",               //数据发送方式
					dataType: "json",           //接受数据格式   
					data: {  
					    modelid: '<?php echo $modelid?>',                   //要传递的数据
						tablename: function() {
							return $("#tablename").val();
						}
					}
			}
			}
		},
		messages: {
			"Models[name]": {
				required: '请输入模型名称',
			}
		}
	});
    $("#setting-index").tableDnD();	
	
});
</script> 
<?php $this->FooterView();?>
</body>
</html>
